home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Text / WASTE / WASTE 1.1.2 Distribution / Pseudo-UPI for THINK Pascal / IntlResources.p < prev    next >
Encoding:
Text File  |  1995-10-12  |  11.6 KB  |  294 lines  |  [TEXT/PJMM]

  1. unit IntlResources;
  2.  
  3. { Pascal Interface to the Macintosh Libraries }
  4.  
  5. { Copyright © Apple Computer Inc. }
  6. { All Rights Reserved }
  7.  
  8. { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
  9.  
  10. interface
  11.     uses
  12.         Types;
  13.  
  14.     const
  15. { Bits in the itlcFlags byte }
  16.         itlcShowIcon = 7;                            {Show icon even if only one script}
  17.         itlcDualCaret = 6;                            {Use dual caret for mixed direction text}
  18. { Bits in the itlcSysFlags word }
  19.         itlcSysDirection = 15;                            {System direction - left to right/right to left}
  20. { the NumberParts indices }
  21.         tokLeftQuote = 1;
  22.         tokRightQuote = 2;
  23.         tokLeadPlacer = 3;
  24.         tokLeader = 4;
  25.         tokNonLeader = 5;
  26.         tokZeroLead = 6;
  27.         tokPercent = 7;
  28.         tokPlusSign = 8;
  29.         tokMinusSign = 9;
  30.         tokThousands = 10;
  31.         tokSeparator = 12;                            {11 is a reserved field}
  32.         tokEscape = 13;
  33.         tokDecPoint = 14;
  34.         tokEPlus = 15;
  35.         tokEMinus = 16;
  36.         tokMaxSymbols = 31;
  37.         curNumberPartsVersion = 1;                            {current version of NumberParts record}
  38.  
  39.         currSymLead = 16;
  40.         currNegSym = 32;
  41.         currTrailingZ = 64;
  42.         currLeadingZ = 128;
  43.  
  44.         mdy = 0;
  45.         dmy = 1;
  46.         ymd = 2;
  47.         myd = 3;
  48.         dym = 4;
  49.         ydm = 5;
  50.  
  51.  
  52.     type
  53.         DateOrders = SInt8;
  54.  
  55.  
  56.     const
  57.         timeCycle24 = 0;                            {time sequence 0:00 - 23:59}
  58.         timeCycleZero = 1;                            {time sequence 0:00-11:59, 0:00 - 11:59}
  59.         timeCycle12 = 255;                            {time sequence 12:00 - 11:59, 12:00 - 11:59}
  60.         zeroCycle = 1;                            {old name for timeCycleZero}
  61.         longDay = 0;                            {day of the month}
  62.         longWeek = 1;                            {day of the week}
  63.         longMonth = 2;                            {month of the year}
  64.         longYear = 3;                            {year}
  65.         supDay = 1;                            {suppress day of month}
  66.         supWeek = 2;                            {suppress day of week}
  67.         supMonth = 4;                            {suppress month}
  68.         supYear = 8;                            {suppress year}
  69.         dayLdingZ = 32;
  70.         mntLdingZ = 64;
  71.         century = 128;
  72.         secLeadingZ = 32;
  73.         minLeadingZ = 64;
  74.         hrLeadingZ = 128;
  75.  
  76. { move OffsetTable to QuickdrawText }
  77.  
  78.     type
  79.         Intl0Rec = packed record
  80.                 decimalPt: CHAR;                                    {decimal point character}
  81.                 thousSep: CHAR;                                    {thousands separator character}
  82.                 listSep: CHAR;                                    {list separator character}
  83.                 currSym1: CHAR;                                    {currency symbol}
  84.                 currSym2: CHAR;
  85.                 currSym3: CHAR;
  86.                 currFmt: UInt8;                                    {currency format flags}
  87.                 dateOrder: UInt8;                                    {order of short date elements: mdy, dmy, etc.}
  88.                 shrtDateFmt: UInt8;                                    {format flags for each short date element}
  89.                 dateSep: CHAR;                                    {date separator character}
  90.                 timeCycle: UInt8;                                    {specifies time cycle: 0..23, 1..12, or 0..11}
  91.                 timeFmt: UInt8;                                    {format flags for each time element}
  92.                 mornStr: packed array[0..3] of CHAR;            {trailing string for AM if 12-hour cycle}
  93.                 eveStr: packed array[0..3] of CHAR;            {trailing string for PM if 12-hour cycle}
  94.                 timeSep: CHAR;                                    {time separator character}
  95.                 time1Suff: CHAR;                                    {trailing string for AM if 24-hour cycle}
  96.                 time2Suff: CHAR;
  97.                 time3Suff: CHAR;
  98.                 time4Suff: CHAR;
  99.                 time5Suff: CHAR;                                    {trailing string for PM if 24-hour cycle}
  100.                 time6Suff: CHAR;
  101.                 time7Suff: CHAR;
  102.                 time8Suff: CHAR;
  103.                 metricSys: UInt8;                                    {255 if metric, 0 if inches etc.}
  104.                 intl0Vers: INTEGER;                                {region code (hi byte) and version (lo byte)}
  105.             end;
  106.         Intl0Ptr = ^Intl0Rec;
  107.         Intl0Hndl = ^Intl0Ptr;
  108.  
  109.         Intl1Rec = packed record
  110.                 days: array[0..6] of Str15;                    {day names}
  111.                 months: array[0..11] of Str15;                    {month names}
  112.                 suppressDay: UInt8;                                    {255 for no day, or flags to suppress any element}
  113.                 lngDateFmt: UInt8;                                    {order of long date elements}
  114.                 dayLeading0: UInt8;                                    {255 for leading 0 in day number}
  115.                 abbrLen: UInt8;                                    {length for abbreviating names}
  116.                 st0: packed array[0..3] of CHAR;            {separator strings for long date format}
  117.                 st1: packed array[0..3] of CHAR;
  118.                 st2: packed array[0..3] of CHAR;
  119.                 st3: packed array[0..3] of CHAR;
  120.                 st4: packed array[0..3] of CHAR;
  121.                 intl1Vers: INTEGER;                                {region code (hi byte) and version (lo byte)}
  122.                 localRtn: array[0..0] of INTEGER;                {now a flag for opt extension}
  123.             end;
  124.         Intl1Ptr = ^Intl1Rec;
  125.         Intl1Hndl = ^Intl1Ptr;
  126.  
  127. {fields for optional itl1 extension}
  128.         Itl1ExtRec = record
  129.                 base: Intl1Rec;                                {un-extended Intl1Rec}
  130.                 version: INTEGER;
  131.                 format: INTEGER;
  132.                 calendarCode: INTEGER;                                {calendar code for this itl1 resource}
  133.                 extraDaysTableOffset: LONGINT;                                {offset in itl1 to extra days table}
  134.                 extraDaysTableLength: LONGINT;                                {length of extra days table}
  135.                 extraMonthsTableOffset: LONGINT;                                {offset in itl1 to extra months table}
  136.                 extraMonthsTableLength: LONGINT;                                {length of extra months table}
  137.                 abbrevDaysTableOffset: LONGINT;                                {offset in itl1 to abbrev days table}
  138.                 abbrevDaysTableLength: LONGINT;                                {length of abbrev days table}
  139.                 abbrevMonthsTableOffset: LONGINT;                                {offset in itl1 to abbrev months table}
  140.                 abbrevMonthsTableLength: LONGINT;                                {length of abbrev months table}
  141.                 extraSepsTableOffset: LONGINT;                                {offset in itl1 to extra seps table}
  142.                 extraSepsTableLength: LONGINT;                                {length of extra seps table}
  143.                 tables: array[0..0] of INTEGER;                {now a flag for opt extension}
  144.             end;
  145.         UntokenTable = record
  146.                 len: INTEGER;
  147.                 lastToken: INTEGER;
  148.                 index: array[0..255] of INTEGER;                {index table; last = lastToken}
  149.             end;
  150.         UntokenTablePtr = ^UntokenTable;
  151.         UntokenTableHandle = ^UntokenTablePtr;
  152.  
  153.         WideChar = record
  154.                 case INTEGER of
  155.                     0: (
  156.                             a: packed array[0..1] of CHAR;        {0 is the high order character}
  157.                     );
  158.                     1: (
  159.                             b: INTEGER;
  160.                     );
  161.             end;
  162.         WideCharArr = record
  163.                 size: INTEGER;
  164.                 data: array[0..9] of WideChar;
  165.             end;
  166.         NumberParts = record
  167.                 version: INTEGER;
  168.                 data: packed array[0..30] of WideChar;        {index by [tokLeftQuote..tokMaxSymbols]}
  169.                 pePlus: WideCharArr;
  170.                 peMinus: WideCharArr;
  171.                 peMinusPlus: WideCharArr;
  172.                 altNumTable: WideCharArr;
  173.                 reserved: packed array[0..19] of CHAR;
  174.             end;
  175.         NumberPartsPtr = ^NumberParts;
  176.  
  177.         Itl4Rec = record
  178.                 flags: INTEGER;                                {reserved}
  179.                 resourceType: LONGINT;                                {contains 'itl4'}
  180.                 resourceNum: INTEGER;                                {resource ID}
  181.                 version: INTEGER;                                {version number}
  182.                 resHeader1: LONGINT;                                {reserved}
  183.                 resHeader2: LONGINT;                                {reserved}
  184.                 numTables: INTEGER;                                {number of tables, one-based}
  185.                 mapOffset: LONGINT;                                {offset to table that maps byte to token}
  186.                 strOffset: LONGINT;                                {offset to routine that copies canonical string}
  187.                 fetchOffset: LONGINT;                                {offset to routine that gets next byte of character}
  188.                 unTokenOffset: LONGINT;                                {offset to table that maps token to canonical string}
  189.                 defPartsOffset: LONGINT;                                {offset to default number parts table}
  190.                 resOffset6: LONGINT;                                {reserved}
  191.                 resOffset7: LONGINT;                                {reserved}
  192.                 resOffset8: LONGINT;                                {reserved}
  193.             end;
  194.         Itl4Ptr = ^Itl4Rec;
  195.         Itl4Handle = ^Itl4Ptr;
  196.  
  197. { New NItl4Rec for System 7.0: }
  198.         NItl4Rec = record
  199.                 flags: INTEGER;                                {reserved}
  200.                 resourceType: LONGINT;                                {contains 'itl4'}
  201.                 resourceNum: INTEGER;                                {resource ID}
  202.                 version: INTEGER;                                {version number}
  203.                 format: INTEGER;                                {format code}
  204.                 resHeader: INTEGER;                                {reserved}
  205.                 resHeader2: LONGINT;                                {reserved}
  206.                 numTables: INTEGER;                                {number of tables, one-based}
  207.                 mapOffset: LONGINT;                                {offset to table that maps byte to token}
  208.                 strOffset: LONGINT;                                {offset to routine that copies canonical string}
  209.                 fetchOffset: LONGINT;                                {offset to routine that gets next byte of character}
  210.                 unTokenOffset: LONGINT;                                {offset to table that maps token to canonical string}
  211.                 defPartsOffset: LONGINT;                                {offset to default number parts table}
  212.                 whtSpListOffset: LONGINT;                                {offset to white space code list}
  213.                 resOffset7: LONGINT;                                {reserved}
  214.                 resOffset8: LONGINT;                                {reserved}
  215.                 resLength1: INTEGER;                                {reserved}
  216.                 resLength2: INTEGER;                                {reserved}
  217.                 resLength3: INTEGER;                                {reserved}
  218.                 unTokenLength: INTEGER;                                {length of untoken table}
  219.                 defPartsLength: INTEGER;                                {length of default number parts table}
  220.                 whtSpListLength: INTEGER;                                {length of white space code list}
  221.                 resLength7: INTEGER;                                {reserved}
  222.                 resLength8: INTEGER;                                {reserved}
  223.             end;
  224.         NItl4Ptr = ^NItl4Rec;
  225.         NItl4Handle = ^NItl4Ptr;
  226.  
  227.         TableDirectoryRecord = record
  228.                 tableSignature: OSType;                                    {4 byte long table name }
  229.                 reserved: LONGINT;                                {Reserved for internal use }
  230.                 tableStartOffset: LONGINT;                                {Table start offset in byte}
  231.                 tableSize: LONGINT;                                {Table size in byte}
  232.             end;
  233.         Itl5Record = record
  234.                 versionNumber: Fixed;                                    {itl5 resource version number }
  235.                 numberOfTables: INTEGER;                                {Number of tables it contains }
  236.                 reserved: array[0..2] of INTEGER;                {Reserved for internal use }
  237.                 tableDirectory: array[0..0] of TableDirectoryRecord;    {Table directory records }
  238.             end;
  239.         RuleBasedTrslRecord = record
  240.                 sourceType: INTEGER;                                {Transliterate target type for the LHS of the rule }
  241.                 targetType: INTEGER;                                {Transliterate target type for the RHS of the rule }
  242.                 formatNumber: INTEGER;                                {Transliterate resource format number }
  243.                 propertyFlag: INTEGER;                                {Transliterate property flags }
  244.                 numberOfRules: INTEGER;                                {Number of rules following this field }
  245.             end;
  246.         ItlcRecord = record
  247.                 itlcSystem: INTEGER;                                {default system script}
  248.                 itlcReserved: INTEGER;                                {reserved}
  249.                 itlcFontForce: SInt8;                                    {default font force flag}
  250.                 itlcIntlForce: SInt8;                                    {default intl force flag}
  251.                 itlcOldKybd: SInt8;                                    {MacPlus intl keybd flag}
  252.                 itlcFlags: SInt8;                                    {general flags}
  253.                 itlcIconOffset: INTEGER;                                {keyboard icon offset; not used in 7.0}
  254.                 itlcIconSide: SInt8;                                    {keyboard icon side; not used in 7.0}
  255.                 itlcIconRsvd: SInt8;                                    {rsvd for other icon info}
  256.                 itlcRegionCode: INTEGER;                                {preferred verXxx code}
  257.                 itlcSysFlags: INTEGER;                                {flags for setting system globals}
  258.                 itlcReserved4: packed array[0..31] of SInt8;            {for future use}
  259.             end;
  260.         ItlbRecord = record
  261.                 itlbNumber: INTEGER;                                {itl0 id number}
  262.                 itlbDate: INTEGER;                                {itl1 id number}
  263.                 itlbSort: INTEGER;                                {itl2 id number}
  264.                 itlbFlags: INTEGER;                                {Script flags}
  265.                 itlbToken: INTEGER;                                {itl4 id number}
  266.                 itlbEncoding: INTEGER;                                {itl5 ID # (optional; char encoding)}
  267.                 itlbLang: INTEGER;                                {current language for script }
  268.                 itlbNumRep: SInt8;                                    {number representation code}
  269.                 itlbDateRep: SInt8;                                    {date representation code }
  270.                 itlbKeys: INTEGER;                                {KCHR id number}
  271.                 itlbIcon: INTEGER;                                {ID # of SICN or kcs#/kcs4/kcs8 suite.}
  272.             end;
  273. { New ItlbExtRecord structure for System 7.0 }
  274.         ItlbExtRecord = packed record
  275.                 base: ItlbRecord;                                {un-extended ItlbRecord}
  276.                 itlbLocalSize: LONGINT;                                {size of script's local record}
  277.                 itlbMonoFond: INTEGER;                                {default monospace FOND ID}
  278.                 itlbMonoSize: INTEGER;                                {default monospace font size}
  279.                 itlbPrefFond: INTEGER;                                {preferred FOND ID}
  280.                 itlbPrefSize: INTEGER;                                {preferred font size}
  281.                 itlbSmallFond: INTEGER;                                {default small FOND ID}
  282.                 itlbSmallSize: INTEGER;                                {default small font size}
  283.                 itlbSysFond: INTEGER;                                {default system FOND ID}
  284.                 itlbSysSize: INTEGER;                                {default system font size}
  285.                 itlbAppFond: INTEGER;                                {default application FOND ID}
  286.                 itlbAppSize: INTEGER;                                {default application font size}
  287.                 itlbHelpFond: INTEGER;                                {default Help Mgr FOND ID}
  288.                 itlbHelpSize: INTEGER;                                {default Help Mgr font size}
  289.                 itlbValidStyles: Style;                                    {set of valid styles for script}
  290.                 itlbAliasStyle: Style;                                    {style (set) to mark aliases}
  291.             end;
  292.  
  293. implementation
  294. end.